package com.itheima.order.feign;

import com.itheima.goods.pojo.Goods;
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

/**
 * @author wang
 * @description
 * @date 2021/7/31 15:15
 */
@FeignClient("goods")
@Component
@RequestMapping("/goods")
public interface GoodsFeign {
    @GetMapping("/{id}")
    Result<Goods> findById(
            @PathVariable("id") Integer id
    );

    @PutMapping("/buy")
    Result buy(@RequestParam(value = "goodId") Integer goodId,
               @RequestParam(value = "buyNum") Integer buyNum);
}
